package com.example.jiagoujiexiang.Service.impl;

import com.example.jiagoujiexiang.Mapper.getLoveDao;
import com.example.jiagoujiexiang.Service.adminService;
import com.example.jiagoujiexiang.Service.petService;
import com.example.jiagoujiexiang.entity.Pet;
import com.example.jiagoujiexiang.entity.User;
import com.example.jiagoujiexiang.entity.subscribe;
import com.example.jiagoujiexiang.Mapper.petDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class petServiceimpl implements petService {

    private final petDao petDao;
    @Autowired
    public petServiceimpl(petDao petDao) {
        this.petDao = petDao;
    }


    public List<Pet> getpetList() {
        return petDao.getpetList();
    }

    
    public Pet getdogsde(int query_number) {
        return petDao.getdogsde(query_number);
    }

    
    public List<Pet> getmoredogspage(int page) {
        int offset = (page - 1) * 8;
        return petDao.getmoredogspage(offset);
    }
    
    public List<Pet> getmoredogs() {
        return petDao.getmoredogs();
    }
    
    public List<Pet> getmorecatspage(int page) {
        int offset = (page - 1) * 8;
        return petDao.getmorecatspage(offset);
    }
    
    public List<Pet> getmorecats() {
        return petDao.getmorecats();
    }
    
    public Pet getcatsde(int query_number) {
        return petDao.getcatsde(query_number);
    }

    
    public List<Pet> getLovepetdog1(int userid) {
        return petDao.getLovepetdog(userid);
    }

    
    public List<Pet> getLovepetcat1(int userid) {
        return petDao.getLovepetcat(userid);
    }

    
    public List<Pet> getsubpetdog1(int userid) {
        return petDao.getsubpetdog(userid);
    }

    
    public List<Pet> getsubpetcat1(int userid) {
        return petDao.getsubpetcat(userid);
    }

    
    public int setsubDog(int pet_id) {
        return petDao.setPetdogsub(pet_id);
    }

    
    public int setsubcat(int pet_id) {
        return petDao.setPetcatsub(pet_id);
    }
}
